package jtk.project4.fleet.field ;


import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.AccordionControl;
import nl.coderight.jazz.form.control.AccordionItem;
import nl.coderight.jazz.form.control.CheckControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.control.RadioControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.MemoField;
import nl.coderight.jazz.form.field.NumberField;
import nl.coderight.jazz.form.field.SelectField;
import nl.coderight.jazz.form.field.SpinnerField;
import nl.coderight.jazz.form.field.TextField;
import nl.coderight.jazz.form.field.button.CheckButton;
import nl.coderight.jazz.form.field.button.MenuButton;
import nl.coderight.jazz.form.field.button.RadioButton;

public class LaborDetailsnewField extends GroupControl  {

	private RadioControl PerformedByField;
	private ComboField TechnicianField;
	private MemoField DescriptionField;
	private SelectField CostCenterField;
	private NumberField LaborRateField;
	private SpinnerField HoursField;
	private TextField TotalCostField;
	private CheckControl LaborCheckField;
	private CheckButton UnderWarrantyField;
	
	
	
	public LaborDetailsnewField(String bindID) {
		setTitle("");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	public void createFields()
	{				
		PerformedByField = new RadioControl ("Employee");
		PerformedByField.addRadioButton(new RadioButton("Employee"), new Object());
		PerformedByField.addRadioButton(new RadioButton("Vendor"), new Object());
		TechnicianField = new ComboField  ("Technician :","");
		DescriptionField = new MemoField ("Description of work performed :");
		DescriptionField.setRows(3);
		CostCenterField = new SelectField ("Cost Center:","fleet");
		LaborRateField = new NumberField ("Labor Rate :",20);
		HoursField = new SpinnerField ("-10","20");
		TotalCostField = new TextField ("Total Cost :",20);
		LaborCheckField = new CheckControl("labor", 1,1 );
		UnderWarrantyField= new CheckButton("Under Warranty");
			
		LaborCheckField.addCheckButton(UnderWarrantyField, "Under Warranty");
		
	}
	public void createLayout(){
		setLayout(new FormLayout())
		
		.addLabel("Performed By :") .addField(PerformedByField)  	
		.addRow()
		.addLabel("Technician :")		.addField(TechnicianField)		
		.addRow()
		.addLabel("Description of work performed :") .addField(DescriptionField)
		.addRow()
		.addLabel("Cost Center :")		.addField(CostCenterField) 
		.addRow()
		.addLabel("Labor Rate :")	.addField(LaborRateField)
		.addRow()
		.addLabel("Hours :")		.addField(HoursField)
		.addRow()
		.addLabel("Total Cost :")		.addField(TotalCostField)
		.addLabel("")		.addField(LaborCheckField)		
		.addRow()
		.addRow();
		
		
		
	}
	
	
	
}
